home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wrnsr094 / wrn.frm < prev    next >
Text File  |  1995-05-08  |  14KB  |  451 lines

  1. VERSION 2.00
  2. Begin Form edit 
  3.    Caption         =   "News Reader"
  4.    ClientHeight    =   7350
  5.    ClientLeft      =   1815
  6.    ClientTop       =   1575
  7.    ClientWidth     =   10005
  8.    ControlBox      =   0   'False
  9.    Height          =   8040
  10.    Icon            =   WRN.FRX:0000
  11.    Left            =   1755
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   7350
  15.    ScaleWidth      =   10005
  16.    Top             =   945
  17.    Width           =   10125
  18.    Begin TextBox Message_text 
  19.       BackColor       =   &H00FFFFFF&
  20.       FontBold        =   -1  'True
  21.       FontItalic      =   0   'False
  22.       FontName        =   "System"
  23.       FontSize        =   9.75
  24.       FontStrikethru  =   0   'False
  25.       FontUnderline   =   0   'False
  26.       Height          =   6855
  27.       Left            =   0
  28.       MultiLine       =   -1  'True
  29.       ScrollBars      =   2  'Vertical
  30.       TabIndex        =   0
  31.       Top             =   600
  32.       Width           =   9975
  33.    End
  34.    Begin PictureBox news_btn 
  35.       Height          =   495
  36.       Left            =   5760
  37.       Picture         =   WRN.FRX:0302
  38.       ScaleHeight     =   465
  39.       ScaleWidth      =   465
  40.       TabIndex        =   8
  41.       Top             =   0
  42.       Width           =   495
  43.    End
  44.    Begin PictureBox mail_btn 
  45.       Height          =   495
  46.       Left            =   5280
  47.       Picture         =   WRN.FRX:0604
  48.       ScaleHeight     =   465
  49.       ScaleWidth      =   465
  50.       TabIndex        =   7
  51.       Top             =   0
  52.       Width           =   495
  53.    End
  54.    Begin PictureBox uudecode_btn 
  55.       Height          =   495
  56.       Left            =   4320
  57.       Picture         =   WRN.FRX:0906
  58.       ScaleHeight     =   465
  59.       ScaleWidth      =   465
  60.       TabIndex        =   6
  61.       Top             =   0
  62.       Width           =   495
  63.    End
  64.    Begin PictureBox rot13_btn 
  65.       Height          =   495
  66.       Left            =   3840
  67.       Picture         =   WRN.FRX:0C08
  68.       ScaleHeight     =   465
  69.       ScaleWidth      =   465
  70.       TabIndex        =   5
  71.       Top             =   0
  72.       Width           =   495
  73.    End
  74.    Begin PictureBox cancel_btn 
  75.       Height          =   495
  76.       Left            =   2880
  77.       Picture         =   WRN.FRX:0F0A
  78.       ScaleHeight     =   465
  79.       ScaleWidth      =   465
  80.       TabIndex        =   4
  81.       Top             =   0
  82.       Width           =   495
  83.    End
  84.    Begin PictureBox save_btn 
  85.       Height          =   495
  86.       Left            =   2400
  87.       Picture         =   WRN.FRX:120C
  88.       ScaleHeight     =   465
  89.       ScaleWidth      =   465
  90.       TabIndex        =   3
  91.       Top             =   0
  92.       Width           =   495
  93.    End
  94.    Begin PictureBox load_btn 
  95.       Height          =   495
  96.       Left            =   1920
  97.       Picture         =   WRN.FRX:150E
  98.       ScaleHeight     =   465
  99.       ScaleWidth      =   465
  100.       TabIndex        =   2
  101.       Top             =   0
  102.       Width           =   495
  103.    End
  104.    Begin PictureBox new_btn 
  105.       Height          =   495
  106.       Left            =   1440
  107.       Picture         =   WRN.FRX:1810
  108.       ScaleHeight     =   465
  109.       ScaleWidth      =   465
  110.       TabIndex        =   1
  111.       Top             =   0
  112.       Width           =   495
  113.    End
  114.    Begin PictureBox next_btn 
  115.       Height          =   495
  116.       Left            =   0
  117.       Picture         =   WRN.FRX:1B12
  118.       ScaleHeight     =   465
  119.       ScaleWidth      =   465
  120.       TabIndex        =   9
  121.       Top             =   0
  122.       Width           =   495
  123.    End
  124.    Begin Menu clip_mnu 
  125.       Caption         =   "&Edit"
  126.       Begin Menu edit_cut_mnu 
  127.          Caption         =   "Cu&t"
  128.          Shortcut        =   ^T
  129.       End
  130.       Begin Menu edit_copy_mnu 
  131.          Caption         =   "&Copy"
  132.          Shortcut        =   ^C
  133.       End
  134.       Begin Menu edit_paste_mnu 
  135.          Caption         =   "&Paste"
  136.          Shortcut        =   ^P
  137.       End
  138.    End
  139.    Begin Menu info_mnu 
  140.       Caption         =   "&Info"
  141.    End
  142.    Begin Menu help_mnu 
  143.       Caption         =   "&Help"
  144.    End
  145. End
  146. Sub cancel_btn_Click ()
  147.    edit.message_text.text = ""
  148.    If message.list1.listcount > 0 Then
  149.       message.enabled = True
  150.    End If
  151.    message.catchup_btn.enabled = True: message.catchup_btn.backcolor = white
  152.    new_btn.enabled = True: new_btn.backcolor = white
  153.    cancel_btn.enabled = False: cancel_btn.backcolor = grey
  154.    mail_btn.enabled = False: mail_btn.backcolor = grey
  155.    news_btn.enabled = False: news_btn.backcolor = grey
  156. End Sub
  157.  
  158. Sub edit_copy_mnu_click ()
  159. ' Copy currently highlighted text to the clipboard
  160.  
  161.     Dim CopyString As String
  162.     
  163.     If message_text.SelLength > 0 Then
  164.     CopyString = message_text.SelText
  165.     Clipboard.SetText CopyString
  166.     End If
  167.  
  168. End Sub
  169.  
  170. Sub edit_cut_mnu_click ()
  171.  
  172. ' Cut currently selected text to the clipboard
  173.  
  174.     Dim CutString As String
  175.     Dim CursorPosition As Integer
  176.  
  177.     If message_text.SelLength > 0 Then
  178.     CursorPosition = message_text.SelStart
  179.     CutString = message_text.SelText
  180.     Clipboard.SetText CutString
  181.     message_text.text = Left$(message_text.text, message_text.SelStart) + Right$(message_text.text, Len(message_text.text) - (message_text.SelStart + message_text.SelLength))
  182.     message_text.SelStart = CursorPosition
  183.     End If
  184.     
  185.  
  186. End Sub
  187.  
  188.  Sub edit_paste_mnu_click ()
  189. ' Paste contents of clipboard into current card
  190.  
  191.     Dim PasteText As String
  192.     Dim CursorPosition As Integer
  193.  
  194.     CursorPosition = message_text.SelStart
  195.     PasteText = Left$(message_text.text, message_text.SelStart) + Clipboard.GetText()
  196.     PasteText = PasteText + Right$(message_text.text, Len(message_text.text) - (message_text.SelStart + message_text.SelLength))
  197.     message_text.text = PasteText
  198.     message_text.SelStart = CursorPosition + Len(Clipboard.GetText())
  199.  
  200.  
  201. End Sub
  202.  
  203. Sub Form_DblClick ()
  204.    If Not mail_btn.enabled Then
  205.       message_text.SetFocus
  206.       If replying Then
  207.      msg_text$ = message_text.text
  208.      i& = InStr(msg_text$, Chr$(10))
  209.      While i& <> 0
  210.         msg_text$ = Left$(msg_text$, i&) + msg_quote$ + Mid$(msg_text$, i& + 1)
  211.         i& = i& + 3
  212.         i& = InStr(i&, msg_text$, Chr$(10))
  213.      Wend
  214.      message_text.text = msg_text$
  215.       Else
  216.      message_text.text = ""
  217.       End If
  218.       message.catchup_btn.enabled = False: message.catchup_btn.backcolor = grey
  219.       message.enabled = False
  220.       cancel_btn.enabled = True: cancel_btn.backcolor = white
  221.       mail_btn.enabled = True: mail_btn.backcolor = white
  222.       If Not reading_mail Then
  223.      news_btn.enabled = True: news_btn.backcolor = white
  224.       End If
  225.    End If
  226. End Sub
  227.  
  228. Sub Form_Load ()
  229.    mail_btn.enabled = False: mail_btn.backcolor = grey
  230.    news_btn.enabled = False: news_btn.backcolor = grey
  231. End Sub
  232.  
  233. Sub Form_Unload (Cancel As Integer)
  234.    Unload file_select
  235.    Unload aboutbox
  236. End Sub
  237.  
  238. Sub get_block (ByVal file_no%, ByVal length%, dest$)
  239.    If Loc(file_no%) + length% > LOF(file_no%) Then
  240.       dest$ = dest$ + Input$(LOF(file_no%) - Loc(file_no%), file_no%)
  241.    Else
  242.       dest$ = dest$ + Input$(length%, file_no%)
  243.    End If
  244. End Sub
  245.  
  246. Sub get_next_name (ByVal Path$, dest$)
  247.    i = 1
  248.    dest$ = Path$ + "." + Mid$(Str$(i), 2)
  249.    While Len(Dir$(dest$)) <> 0 And i < 1000
  250.      i = i + 1
  251.      dest$ = Path$ + "." + Mid$(Str$(i), 2)
  252.    Wend
  253. End Sub
  254.  
  255. Sub Help_mnu_Click ()
  256.    res = winexec("WINHELP WRN.HLP", 1)
  257. End Sub
  258.  
  259. Sub info_mnu_Click ()
  260.    edit.enabled = false
  261.    aboutbox.Show
  262. End Sub
  263.  
  264. Sub load_btn_Click ()
  265.    filename$ = get_filename("c:\")
  266.    If Len(filename$) <> 0 Then
  267.       message_text.text = load_file(filename$)
  268.    End If
  269. End Sub
  270.  
  271. Sub mail_btn_Click ()
  272.    dest$ = author$
  273.    sig% = 1
  274.    Call get_header(dest$, subject$, sig%, True)
  275.    seq_file = fopen(seq_path$, "r")
  276.    Input #seq_file, seq_num%
  277.    Close #seq_file
  278.    seq$ = Format$(seq_num%, "0000")
  279.       
  280.    out_filename$ = out_path$ + seq$
  281.    date_time$ = Format$(Now, "ddd, dd mmm yy hh:mm:ss ") + time_zone$
  282.    cur_time# = Now
  283.    out_file = fopen(out_filename$ +